package Tester;

import Flyer.FlyMode;
import Flyer.FlyUnderAutoPilot;
import Flyer.FlyWithTurbo;
import org.junit.Before;
import org.junit.Test;
import spaceCraft.ProductInfo;
import spaceCraft.Engine;

import static org.junit.Assert.assertTrue;

/**
 * Created by IntelliJ IDEA.
 * User: anton
 * Date: 23.03.12
 * Time: 18:49
 * To change this template use File | Settings | File Templates.
 */
public class FlyerTest {

    private int velocity;
    Engine hyperEngine;
    private String turboReport;
    private String autoReport;

    @Before
    public void setUp() {
        velocity = 3000;
        hyperEngine = new Engine(new ProductInfo("BeLAZ", "Titan"), velocity);
        turboReport = ("Velocity is over " + (hyperEngine.getAcceleration() * 4) + " thousands km/sec.");
        autoReport = ("Velocity is over " + hyperEngine.getAcceleration() + " thousands km/sec.");
    }

    @Test
    public void testFlyWithTurbo() {
        FlyMode flyMode = new FlyWithTurbo();
        assertTrue(flyMode.fly(hyperEngine).contains(turboReport));
    }

    @Test
    public void testFlyUnderAutoPilot() {
        FlyMode flyMode = new FlyUnderAutoPilot();
        assertTrue(flyMode.fly(hyperEngine).contains(autoReport));
    }
}
